package Demo11;
/*
java.util.Math;

public static double abs(double num);获取绝对值--多种重载
public static double ceil(double num);向上取整
public static double floor(double num);向下取整
public static long round(double num);四舍五入

Math.PI-------圆周率；（double）

 */
public class Demo03Math {
    public static void main(String[] args) {
        //绝对值
        System.out.println(Math.abs(3.14));//3.14
        System.out.println(Math.abs(0));//0
        System.out.println(Math.abs(-2.0));//2.0
        System.out.println("============");
        //向上取整
        System.out.println(Math.ceil(3.9));//4.0
        System.out.println(Math.ceil(3.1));//4.0
        System.out.println(Math.ceil(3.0));//3.0
        System.out.println("=============");
        //向下取整
        System.out.println(Math.floor(3.5));//3.0
        System.out.println(Math.floor(3.9));//3.0
        System.out.println("===========");
        //四舍五入
        System.out.println(Math.round(30.1));//30
        System.out.println(Math.round(10.5));//11
        System.out.println("============");
        //圆周率；
        System.out.println(Math.PI); //3.141592653589793
    }
}
